#pragma once
#include "CGeometry.h"

class HWClip;
class TransformAndClipStack;

class CRectangleGeometry :
	public CGeometry
{

private: 
	CRectangleGeometry(CCoreServices * pCore);
public: 
	static HRESULT Create(CDependencyObject * * ppObject, CREATEPARAMETERS * pCreate);
	virtual XUINT32 GetTypeIndex() const;
	virtual HRESULT AddToPath(const CMILMatrix * pMatrix);
	virtual XBOOL CanBeAccelerated();
	virtual HRESULT CloneForTarget(CRenderTarget * pRenderTarget, CGeometry * * ppGeometry);
	static HRESULT ApplyClip(CRectangleGeometry * pClipGeometry, HWClip * pClip);
	static HRESULT ApplyClip(CRectangleGeometry * pClipGeometry, TransformAndClipStack * pClip);
	static void ApplyClip(CRectangleGeometry * pClipGeometry, const CMILMatrix * pTransformToClipRectSpace, struct XRECTF_WH * pClipRect);
	void GetRect(struct XRECTF_WH * pRect);
private: 
	static HRESULT InitializeRectangleClip(CRectangleGeometry * pClipGeometry, HWClip * pClip);
public: 
	struct XRECTF_WH m_rc;
	XFLOAT m_eRadiusX;
	XFLOAT m_eRadiusY;
protected: 
	virtual HRESULT UpdateAcceleratedGeometryVirtual(const struct D2DPrecomputeParams & cp);
	virtual HRESULT GetPrintGeometryVirtual(const struct D2DPrecomputeParams & cp, const struct D2DRenderParams & printParams, struct IPALAcceleratedGeometry * * ppGeometry);
public: 
	virtual HRESULT GetBounds(struct XRECTF_RB * pBounds);
	virtual HRESULT GetWidenedBounds(const CPlainPen & pen, struct XRECTF_RB * pBounds);
	virtual HRESULT HitTestFill(const HitTestPolygon & target, const CMILMatrix * pTransform, XBOOL * pHit);
	virtual HRESULT HitTestFill(const struct XPOINTF & target, const CMILMatrix * pTransform, XBOOL * pHit);
private: 
	static XBOOL CanDoFastWidening(const CPlainPen & pen, const struct XRECTF_WH & bounds);
protected: 
	virtual HRESULT VisitSinkInternal(struct IPALGeometrySink * pSink);



};